#!/bin/sh

# 询问用户是否是早上
echo "Is it morning? Please answer yes or no"
read timeofday

# 使用case语句判断用户输入
case "$timeofday" in
    # 如果用户输入是yes或y(不区分大小写),则输出"Good Morning"
    yes | y | Yes | YES ) echo "Good Morning";;
    # 如果用户输入以n或N开头,则输出"Good Afternoon"
    n*  | N* )                echo "Good Afternoon";;
    # 其他情况,输出"Sorry, answer not recognised"
    * )                           echo "Sorry, answer not recognised";;
esac

# 程序正常退出
exit 0
